package com.imesne.office.excel.html;

import java.util.Collection;
import java.util.Map;

/**
 * Created by liyd on 17/7/17.
 */
public class ExcelHtml {

    private String beginFragment;

    private String endFragment;

    private String inlineStyle;

    private Map<Integer, String> sheetHtmlMap;

    public String getHtml() {
        StringBuilder sb = new StringBuilder();
        sb.append(beginFragment)
                .append(inlineStyle);
        for (String s : sheetHtmlMap.values()) {
            sb.append(s).append(System.lineSeparator());
        }
        sb.append(endFragment);
        return sb.toString();
    }

    public String getSheetHtml(int sheetNum) {
        return sheetHtmlMap.get(sheetNum - 1);
    }

    public Collection<String> getSheetHtmls() {
        return sheetHtmlMap.values();
    }

    public String getBeginFragment() {
        return beginFragment;
    }

    public void setBeginFragment(String beginFragment) {
        this.beginFragment = beginFragment;
    }

    public String getEndFragment() {
        return endFragment;
    }

    public void setEndFragment(String endFragment) {
        this.endFragment = endFragment;
    }

    public String getInlineStyle() {
        return inlineStyle;
    }

    public void setInlineStyle(String inlineStyle) {
        this.inlineStyle = inlineStyle;
    }

    public Map<Integer, String> getSheetHtmlMap() {
        return sheetHtmlMap;
    }

    public void setSheetHtmlMap(Map<Integer, String> sheetHtmlMap) {
        this.sheetHtmlMap = sheetHtmlMap;
    }
}
